package org.coding.springbootdemocommandline.beanlife;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author guoxuehe
 * @date 2021/1/26 10:40
 * @desc
 **/
public class MyBeanProcessor implements BeanPostProcessor {
    public MyBeanProcessor() {
        super();
        System.out.println("这是beanprocessor 实现类构造器");
    }

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("BeanPostProcessor接口方法postProcessBeforeInitialization对属性进行修改");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("BeanPostProcessor接口方法postProcessAfterInitialization对属性进行修改");
        return bean;
    }
}
